package com.xiaobai.stream_practice;

import com.xiaobai.stream_practice.entity.Author;
import com.xiaobai.stream_practice.entity.Book;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangtw
 * @ClassName PrepareWork
 * @description: 准备工作
 * @date 2024/2/1316:52
 */
public class PrepareWork {

    /**
     * 获取数据集合
     * @return
     */
    public static List<Author> getAuthorData() {
        Book book1 = Book.builder().name("Java核心技术")
                .price(59.4).build();
        Book book2 = Book.builder().name("码农翻身")
                .price(39.3).build();
        Book book3 = Book.builder().name("设计模式")
                .price(67D).build();
        Book book4 = Book.builder().name("剑指Java").price(36D).build();
        Book book5 = Book.builder().name("Java并发编程之美").price(50.3).build();
        Book book6 = Book.builder().name("Java8实战").price(40.5).build();

        List<Book> bookList1 = new ArrayList<>();
        bookList1.add(book1);
        bookList1.add(book2);
        bookList1.add(book3);

        List<Book> bookList2 = new ArrayList<>();
        bookList2.add(book4);
        bookList2.add(book5);

        List<Book> bookList3 = new ArrayList<>();
        bookList3.add(book6);

        Author author1 = Author.builder()
                .realName("张三")
                .age(41)
                .profile("拉开大家疯狂的就撒开积分的空间撒了饭")
                .sex("男")
                .salary(8000D)
                .bookList(bookList1).build();

        Author author2 = Author.builder()
                .realName("李四")
                .age(35)
                .profile("fdjsklafjdklsa")
                .sex("男")
                .salary(9000D)
                .bookList(bookList2).build();

        Author author3 = Author.builder()
                .realName("王五")
                .age(44)
                .profile("的UI为i哦uu哦u乌俄u无恶u五")
                .sex("男")
                .salary(6500D)
                .bookList(bookList3).build();

        Author author4 = Author.builder()
                .realName("孙一")
                .age(30)
                .profile("积分可贷款，草莓，新农村，男明星们，内存，你们，")
                .sex("男")
                .salary(7500D).build();

        Author author5 = Author.builder()
                .realName("赵二")
                .age(28)
                .profile("发啊副度撒ufdsvkjj")
                .sex("女")
                .salary(7999D).build();

        Author author6 = Author.builder()
                .realName("赵二")
                .age(28)
                .profile("发啊副度撒ufdsvkjj")
                .sex("女")
                .salary(7999D).build();

        List<Author> authorList = new ArrayList<>();
        authorList.add(author1);
        authorList.add(author2);
        authorList.add(author3);
        authorList.add(author4);
        authorList.add(author5);
        authorList.add(author6);

        return authorList;
    }
}
